package com.sam.enumeration;

public enum Operation3Extends implements OperationInterface {

	MOD("%") {
		@Override
		public double apply(double x, double y) {

			return x % y;
		}
	};

	private final String symbol;

	private Operation3Extends(String symbol) {
		this.symbol = symbol;
	}

	public String getSymbol() {
		return symbol;
	}

	@Override
	public String toString() {

		return symbol;
	}

	public static <T extends Enum<T> & OperationInterface> void test(
			Class<T> opSet, double x, double y) {
		for (OperationInterface op : opSet.getEnumConstants()) {
			System.out.println(op + "结果：" + op.apply(x, y));
		}
	}

	public static void main(String args[]) {
		Operation3Extends.test(Operation3Extends.class, 1, 2);
	}

}
